
const http = require('https');
const cheerio = require("cheerio")
const url ="https://www.itcast.cn/news/json/f1f5ccee-1158-49a6-b7c4-f0bf40d5161a.json";

http.get(url, resp=> {
 let data = [];
  
 resp.on('data', (chunk) => {
//   data += chunk;
data.push(chunk)
 });
  
 // The whole response has been received. Print out the result.
 resp.on('end', () => {
  console.log(data);
  let str = ""
        str =Buffer.concat(data).toString("utf-8");
let list  = JSON.parse(str).data;
         console.log(list);
console.log(list[2])
//        
    
 });

}).on("error", (err) => {
 console.log("Error: " + err.message);
});